﻿Public Class KisaVadeliYetkiBelgesiRapor
    Inherits ProcessReport

    Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
        Select Case e.EventType
            Case EventType.Initialize
				Text = "Kısa Vadeli Yardım Yetki Belgesi Listesi"
                InitialHelp = "Rapor parametrelerini girin."
                AddField("@Sigortali", "nl")
                AddField("Tarih1:Tarih[label=Baş.Tarih]", "", "20080101")
                AddField("Tarih2:Tarih[label=Bit.Tarih]", "nl", YMD(Today))
            Case EventType.ValidateForm
				Q("select distinct a.*,b.adi,b.soyadi from ssd..kvyetkibelge a left join ssd..sgenel b on a.sno = b.sno where a.belgetar between :t1 and :t2")
				If Not IsEmpty("Sigortali") Then Q("and a.sno = " & Input("Sigortali"))
				Q("order by a.kimlik")
                Rs = Remote.OpenSQL("*", Input("Tarih1"), Input("Tarih2"))
                e.Result = True
            Case EventType.ReportHeader
                Report.PrintHeader("KISA VADELİ YARDIM YETKİ BELGESİ LİSTESİ")
            Case EventType.PageHeader
                Report.SetColumns("Kimlik;Sig.No.;Adi Soyadi;Yet.Kimlik;Yet.Adi Soyadi;Belge Tar.", "3;2;6;3;6;2", "c;c;l;c;l;d", "--")
            Case EventType.ReportDetail
                Do Until Rs.EOF
                    Report.Print(Rs("kimlik"), Rs("sno"), Trim(Rs("adi")) & " " & Trim(Rs("soyadi")), Rs("yskimlik"), Rs("ysadisoyadi"), Rs("belgetar"))
                    Rs.MoveNext()
                Loop
        End Select
    End Sub

End Class
